﻿using Common.Infrastructure;
using System;
using System.ComponentModel.DataAnnotations;

namespace StatsData.Data.Entity
{
    /// <summary>
    /// 工单人工工时统计（工单、线体、日期、工序）维度
    /// </summary>
    public class t_bi_wip_work_hour_statis_labor : EntityBase
    {
        [EntityFieldIndex]
        [Display(Description = "工单ID")]
        public string work_id { get; set; }

        [EntityFieldLength(60)]
        [Display(Description = "工单编号")]
        public string work_code { get; set; }

        [EntityFieldIndex]
        [Display(Description = "产品ID")]
        public string product_id { get; set; }

        [EntityFieldLength(60)]
        [Display(Description = "产品编号")]
        public string product_code { get; set; }

        [EntityFieldIndex]
        [Display(Description = "生产日期")]
        public DateTime time { get; set; }

        [Display(Description = "线体ID")]
        public string line_id { get; set; }

        [EntityFieldLength(60)]
        [Display(Description = "线体编号")]
        public string line_code { get; set; }

        [EntityFieldLength(60)]
        [Display(Description = "线体名称")]
        public string line_name { get; set; }

        public string line_name_en { get; set; }

        [Display(Description = "用户ID")]
        public string line_supervisor_id { get; set; }

        [EntityFieldLength(20)]
        [Display(Description = "用户名称")]
        public string line_supervisor_name { get; set; }

        [EntityFieldLength(40)]
        [Display(Description = "用户编号")]
        public string line_supervisor_code { get; set; }

        /// <summary>
        /// MES工序
        /// </summary>
        [Display(Description = "MES工序ID")]
        public string procedure_id { get; set; }

        /// <summary>
        /// SAP工艺路线版本
        /// </summary>
        [EntityFieldLength(50)]
        [Display(Description = "SAP工艺路线版本")]
        public string process_version { get; set; }

        /// <summary>
        /// ASSY/PACK
        /// </summary>
        [EntityFieldLength(20)]
        [Display(Description = "ASSY(总装)/PACK(包装)")]
        public string section_code { get; set; }

        /// <summary>
        /// 作业时长
        /// </summary>
        [Display(Description = "作业时长")]
        public decimal work_last_hour { get; set; }

        /// <summary>
        /// 作业开始时间
        /// </summary>
        [Display(Description = "作业开始时间")]
        public DateTime? work_begin_time { get; set; }

        /// <summary>
        /// 作业结束时间
        /// </summary>
        [Display(Description = "作业结束时间")]
        public DateTime? work_end_time { get; set; }

        /// <summary>
        /// 产出数
        /// </summary>
        [Display(Description = "产出数")]
        public decimal output_qty { get; set; }

        /// <summary>
        /// 投入人力
        /// </summary>
        [Display(Description = "投入人力")]
        public decimal actual_manpower { get; set; }

        /// <summary>
        /// 总工时 = 投入人力 * 作业时长
        /// </summary>
        [Display(Description = "总工时(投入人力 * 作业时长)")]
        public decimal total_actual_labor_work_hour { get; set; }

        /// <summary>
        /// 实际人工工时单位
        /// </summary>
        [EntityFieldLength(5)]
        [Display(Description = "实际人工工时单位(S秒)")]
        public string actual_labor_work_hour_unit { get; set; }

        /// <summary>
        /// 标准人工工时
        /// </summary>
        [Display(Description = "标准人工工时")]
        public decimal standard_labor_work_hour { get; set; }

        [EntityFieldLength(5)]
        [Display(Description = "标准人工工时单位(S秒)")]
        public string standard_labor_work_hour_unit { get; set; }

        /// <summary>
        /// 标准总工时
        /// </summary>
        [Display(Description = "标准总工时")]
        public decimal total_standard_labor_work_hour { get; set; }

        /// <summary>
        /// 瓶颈工时
        /// </summary>
        [Display(Description = "瓶颈工时")]
        public decimal bottleneck_work_hour { get; set; }

        /// <summary>
        /// 标准人力配置
        /// </summary>
        [Display(Description = "标准人力配置")]
        public decimal standard_manpower { get; set; }

        /// <summary>
        /// 设备运行时长（单位S）
        /// </summary>
        [Display(Description = "设备运行时长（单位S）")]
        public decimal machine_run_hour { get; set; }

        /// <summary>
        /// 设备故障时长（单位S）
        /// </summary>
        [Display(Description = "设备故障时长（单位S）")]
        public decimal machine_failure_hour { get; set; }

        /// <summary>
        /// 设备待机时长（单位S）
        /// </summary>
        [Display(Description = "设备待机时长（单位S）")]
        public decimal machine_standby_hour { get; set; }

        /// <summary>
        /// 设备故障工时（单位S）
        /// </summary>
        [Display(Description = "设备故障工时（单位S）")]
        public decimal machine_failure_work_hour { get; set; }

        /// <summary>
        /// 设备待机工时（单位S）
        /// </summary>
        [Display(Description = "设备待机工时（单位S）")]
        public decimal machine_standby_work_hour { get; set; }

        /// <summary>
        /// 是否有设备标准工时
        /// </summary>
        [Display(Description = "是否有设备标准工时")]
        public bool has_machine_standard_time { get; set; }

        /// <summary>
        /// 车间
        /// </summary>
        [Display(Description = "车间ID")]
        public string workshop_id { get; set; }

        /// <summary>
        /// SAP工序编号
        /// </summary>
        [EntityFieldLength(50)]
        [Display(Description = "SAP工序编号")]
        public string sap_procedure_code { get; set; }
    }
}
